package com.ruoyi.system.domain;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.utils.DateUtils;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 催化剂质量检测对象 sys_catalysts_quality
 * 
 * @author ruoyi
 * @date 2025-07-11
 */
@Data
public class SysCatalystsQuality extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 催化剂质量id */
    private Long catalystsQualityId;

    /** 批次号 */
    @Excel(name = "批次号")
    private String batchId;

    /** 批次编号 */
    @Excel(name = "批次编号")
    private String batchNo;

    /** 供应商名称 */
    @Excel(name = "供应商名称")
    private String provider;

    /** 型号 */
    @Excel(name = "型号")
    private String sku;

    /** 到货日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "到货日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date getTime;

    /** 外观 */
    @Excel(name = "外观")
    private String appearance;

    /** 宽度 */
    @Excel(name = "宽度")
    private BigDecimal width;

    /** 裁切宽度 */
    @Excel(name = "裁切宽度")
    private BigDecimal outWidth;

    /** 高度 */
    @Excel(name = "高度")
    private BigDecimal height;

    /** 重量 */
    @Excel(name = "重量")
    private BigDecimal weight;

    /** 复测重量 */
    @Excel(name = "复测重量")
    private BigDecimal againWeight;

    /** 净重（煅烧减重） */
    @Excel(name = "净重", readConverterExp = "煅烧减重")
    private BigDecimal outWeight;

    /** 层数 */
    @Excel(name = "层数")
    private Integer floor;

    /** 堵孔面积 */
    @Excel(name = "堵孔面积")
    private BigDecimal area;

    /** 图片地址 */
    @Excel(name = "图片地址")
    private String imageUrl;

    /** 第三方批次号 */
    @Excel(name = "第三方批次号")
    private String thirdBatchId;

    /** 第三方编号 */
    @Excel(name = "第三方编号")
    private String thirdBatchNo;

    /** 尺寸判定 */
    @Excel(name = "尺寸判定")
    private String sizeDetermination;

    /** 初步判定 */
    @Excel(name = "初步判定")
    private String initiallyDetermine;

    /** 让步放行 */
    @Excel(name = "让步放行")
    private String concessionRelease;

    /** 判定结果 */
    @Excel(name = "判定结果")
    private String determineResult;

    /** 上传时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "上传时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date uploadTime;

    /** 审核人 */
    @Excel(name = "审核人")
    private String auditor;

    /** 检测人 */
    @Excel(name = "检测人")
    private String inspector;

    /** 调试开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "调试开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date debugBeginTime;

    /** 调试结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "调试结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date debugEndTime;

    /** 简单时间 yyyy-MM-dd*/
    private String simpleCreateDate;

    /** 导出类型 0:单体，1多个 */
    private String exportType;

    public String getSimpleCreateDate(){
        if (this.getCreateTime() == null){
            return "";
        }
        return new SimpleDateFormat("MM.dd").format(this.getCreateTime());
    }

    public List<String > toContentList(){
        List<String> list = new ArrayList<>();
        // 批次号
        list.add(getBatchId() + getBatchNo());
        //外观
        list.add("");
        //层数
        list.add(getFloor().toString());
        //重量
        if (getWeight()== null){
            list.add("");
        }else {
            list.add(getWeight().toString());
        }
        //净重
        if (getOutWeight()== null){
            list.add("");
        }else {
            list.add(getOutWeight().toString());
        }
        // 裁切宽度
        if (getOutWidth()== null){
            list.add("");
        }else {
            list.add(getOutWidth().toString());
        }
        //堆叠宽度
        if (getWidth()== null){
            list.add("");
        }else {
            list.add(getWidth().toString());
        }
        //尺寸判定getSizeDetermination
        list.add("");
        //初步判定getInitiallyDetermine
        list.add("");
        //让步放行getConcessionRelease
        list.add("");
        //最终判定getDetermineResult
        list.add("");
        //第三方批次号getThirdBatchId
        list.add(getThirdBatchId());
        //第三方批次编号getThirdBatchNo
        list.add(getThirdBatchNo());
        //复测重量getAgainWeight
        if (getAgainWeight()== null){
            list.add("");
        } else {
            list.add(getAgainWeight().toString());
        }
        //备注
        list.add(getRemark());
        return list;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("catalystsQualityId", getCatalystsQualityId())
            .append("batchId", getBatchId())
            .append("batchNo", getBatchNo())
            .append("provider", getProvider())
            .append("sku", getSku())
            .append("getTime", getGetTime())
            .append("appearance", getAppearance())
            .append("width", getWidth())
            .append("outWidth", getOutWidth())
            .append("height", getHeight())
            .append("weight", getWeight())
            .append("againWeight", getAgainWeight())
            .append("outWeight", getOutWeight())
            .append("floor", getFloor())
            .append("area", getArea())
            .append("imageUrl", getImageUrl())
            .append("thirdBatchId", getThirdBatchId())
            .append("thirdBatchNo", getThirdBatchNo())
            .append("sizeDetermination", getSizeDetermination())
            .append("initiallyDetermine", getInitiallyDetermine())
            .append("concessionRelease", getConcessionRelease())
            .append("determineResult", getDetermineResult())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("uploadTime", getUploadTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("auditor", getAuditor())
            .append("inspector", getInspector())
            .append("debugBeginTime", getDebugBeginTime())
            .append("debugEndTime", getDebugEndTime())
            .toString();
    }
}
